// Copyright 2007 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package lichen.internal.services;

import lichen.entities.forum.Forum;
import lichen.services.Menu;

/**
 * 针对forum的菜单.
 * @author jcai
 * @version $Revision: 59 $
 * @since 0.0.2
 */
public class ForumMenu implements Menu {

	private Forum _forum;
	private boolean _disabled;
	private static final String VIEW_FORUM_PATH = "forum/view";
	

	public ForumMenu(Forum forum,boolean disabled){
		this._forum=forum;
		this._disabled = disabled;
	}
	/**
	 * @see lichen.services.Menu#getPageContext()
	 */
	public Object[] getPageContext() {
		return new Object[]{_forum};
	}

	/**
	 * @see lichen.services.Menu#getPagePath()
	 */
	public String getPagePath() {
		return VIEW_FORUM_PATH;
	}

	/**
	 * @see lichen.services.Menu#getPageText()
	 */
	public String getPageText() {
		
		return this._forum.getName();
	}

	/**
	 * @see lichen.services.Menu#isDisabled()
	 */
	public boolean isDisabled() {
		return this._disabled;
	}

}
